package com.zmn.plat.admin.controller.plat.biztype;

import java.util.List;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zmn.common.constant.GlobalConsts;
import com.zmn.common.dto2.ResponseDTO;
import com.zmn.plat.model.entity.plat.biztype.PlatBizType;

/**
 * 平台开通业务类型
 *
 * @author linfeng
 *
 * @since 2020/09/18 18:22
 */
@RestController
@RequestMapping("/plat/biztype/")
public class PlatBizTypeModifyController extends PlatBizTypeBaseController {

    /**
     * 新增修改平台业务类型
     * 
     * @param platBiztypes
     * @since 2020-09-04 14:27:50
     * @return
     */
    @RequestMapping(value = "addEdit")
    public ResponseDTO addEdit(@RequestBody List<PlatBizType> platBiztypes) {
        try {
            platBizTypeBService.modifyPlatBizType(platBiztypes, getMcStaff());
        } catch (Exception e) {
            logger.error("平台开通业务类型保存失败:", e);
            return ResponseDTO.fail("平台开通业务类型保存失败");
        }

        return ResponseDTO.success(GlobalConsts.YES, "保存成功");
    }
}
